package fzu.functiongather.Code;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;

import fzu.functiongather.R;
import fzu.functiongather.mUtils.Code;

/**
 * Created by Administrator on 2016/8/16.
 */
public class CodeActivity extends Activity implements View.OnClickListener{
    private ImageView iv_code;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.code_main);
        initView();
        initWidget();
    }
    private void initView(){
        iv_code=(ImageView)findViewById(R.id.iv_code);
        //将验证码用图片的形式显示出来
        iv_code.setImageBitmap(Code.getInstance().createBitmap());
    }
    private void initWidget(){
        iv_code.setOnClickListener(this);
    }
    @Override
    public void onClick(View v) {
        switch (v.getId()){
            case R.id.iv_code:
                iv_code.setImageBitmap(Code.getInstance().createBitmap());
                break;
        }
    }
}
